package com.sq.shortlink.admin.controller;

import com.sq.shortlink.admin.common.convension.result.Result;
import com.sq.shortlink.admin.remoto.ShortLinkRemoteService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * URL 标题控制层
 * @author quan
 */
@RestController
@RequestMapping("/api/short-link/admin/v1")
public class UrlTitleController {

    private final ShortLinkRemoteService shortLinkRemoteService = new ShortLinkRemoteService() {
    };
    @GetMapping("/title")
    public Result<String> getTitleByUrl(@RequestParam("url") String url){
        return shortLinkRemoteService.getTitleByUrl(url);
    }

}
